home *** CD-ROM | disk | FTP | other *** search
-
-
-
- iiiinnnnssssqqqq((((DDDD3333)))) iiiinnnnssssqqqq((((DDDD3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- _iiii_nnnn_ssss_qqqq - insert a message into a queue
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_rrrr_eeee_aaaa_mmmm_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
- _iiii_nnnn_tttt _iiii_nnnn_ssss_qqqq_((((_qqqq_uuuu_eeee_uuuu_eeee______tttt _****_q_,,,, _mmmm_bbbb_llll_kkkk______tttt _****_e_m_p_,,,, _mmmm_bbbb_llll_kkkk______tttt _****_n_m_p_))))_;;;;
-
- AAAArrrrgggguuuummmmeeeennnnttttssss
- _q Pointer to the queue containing message _e_m_p.
-
- _e_m_p Pointer to the existing message before which the new message is
- to be inserted.
-
- _n_m_p Pointer to the new message to be inserted.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _iiii_nnnn_ssss_qqqq inserts a message into a queue. The message to be inserted, _n_m_p, is
- placed in the queue pointed to by _q, immediately before the message, _e_m_p.
- If _e_m_p is _NNNN_UUUU_LLLL_LLLL, the new message is placed at the end of the queue. All
- flow control parameters are updated. The service procedure is scheduled
- to run unless disabled by a previous call to _nnnn_oooo_eeee_nnnn_aaaa_bbbb_llll_eeee(D3).
-
- RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
- If _n_m_p was successfully enqueued, _iiii_nnnn_ssss_qqqq returns 1. Otherwise, _iiii_nnnn_ssss_qqqq
- returns 0.
-
- UUUUSSSSAAAAGGGGEEEE
- Messages are ordered in the queue based on their priority, as described
- in _ssss_rrrr_vvvv(D2). If an attempt is made to insert a message out of order in
- the queue, then _n_m_p is not enqueued.
-
- The insertion can fail if there is not enough memory to allocate the
- accounting data structures used with messages whose priority bands are
- greater than zero.
-
- If _e_m_p is non-_NNNN_UUUU_LLLL_LLLL, it must point to a message in the queue pointed to by
- _q, or a system panic could result.
-
- LLLLeeeevvvveeeellll
- Base or Interrupt.
-
- SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
- Does not sleep.
-
- Driver-defined basic locks, read/write locks, and sleep locks may be held
- across calls to this function.
-
- EEEExxxxaaaammmmpppplllleeee
- This routine illustrates the use of _iiii_nnnn_ssss_qqqq to insert a message into the
- middle of a queue. This routine can be used to strip all the _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO
- headers off all messages on a queue. We traverse the list of messages on
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- iiiinnnnssssqqqq((((DDDD3333)))) iiiinnnnssssqqqq((((DDDD3333))))
-
-
-
- the queue, looking for _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO messages (line 9). When one is found, we
- remove it from the queue using _rrrr_mmmm_vvvv_qqqq(D3) (line 10). If there is no data
- portion to the message (line 11), we free the entire message using
- _ffff_rrrr_eeee_eeee_mmmm_ssss_gggg(D3). Otherwise, for every _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO message block in the message,
- we strip the _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO block off using _uuuu_nnnn_llll_iiii_nnnn_kkkk_bbbb(D3) (line 15) and free the
- message block using _ffff_rrrr_eeee_eeee_bbbb(D3). When the header has been stripped, the
- data portion of the message is inserted back into the queue where it was
- originally found (line 19).
- _1111 _vvvv_oooo_iiii_dddd
- _2222 _ssss_tttt_rrrr_iiii_pppp_rrrr_oooo_tttt_oooo_((((_qqqq_))))
- _3333 _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
- _4444 _{{{{
- _5555 _mmmm_bbbb_llll_kkkk______tttt _****_eeee_mmmm_pppp_,,,, _****_nnnn_mmmm_pppp_,,,, _****_mmmm_pppp_;;;;
- _6666 _mmmm_pppp _==== _qqqq_----_>>>>_qqqq______ffff_iiii_rrrr_ssss_tttt_;;;;
- _7777 _wwww_hhhh_iiii_llll_eeee _((((_mmmm_pppp_)))) _{{{{
- _8888 _eeee_mmmm_pppp _==== _mmmm_pppp_----_>>>>_bbbb______nnnn_eeee_xxxx_tttt_;;;;
- _9999 _iiii_ffff _((((_mmmm_pppp_----_>>>>_bbbb______dddd_aaaa_tttt_aaaa_pppp_----_>>>>_dddd_bbbb______tttt_yyyy_pppp_eeee _====_==== _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO_)))) _{{{{
- _1111_0000 _rrrr_mmmm_vvvv_qqqq_((((_qqqq_,,,, _mmmm_pppp_))))_;;;;
- _1111_1111 _iiii_ffff _((((_mmmm_ssss_gggg_dddd_ssss_iiii_zzzz_eeee_((((_mmmm_pppp_)))) _====_==== _0000_)))) _{{{{
- _1111_2222 _ffff_rrrr_eeee_eeee_mmmm_ssss_gggg_((((_mmmm_pppp_))))_;;;;
- _1111_3333 _}}}} _eeee_llll_ssss_eeee _{{{{
- _1111_4444 _wwww_hhhh_iiii_llll_eeee _((((_mmmm_pppp_----_>>>>_bbbb______dddd_aaaa_tttt_aaaa_pppp_----_>>>>_dddd_bbbb______tttt_yyyy_pppp_eeee _====_==== _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO_)))) _{{{{
- _1111_5555 _nnnn_mmmm_pppp _==== _uuuu_nnnn_llll_iiii_nnnn_kkkk_bbbb_((((_mmmm_pppp_))))_;;;;
- _1111_6666 _ffff_rrrr_eeee_eeee_bbbb_((((_mmmm_pppp_))))_;;;;
- _1111_7777 _mmmm_pppp _==== _nnnn_mmmm_pppp_;;;;
- _1111_8888 _}}}}
- _1111_9999 _iiii_nnnn_ssss_qqqq_((((_qqqq_,,,, _eeee_mmmm_pppp_,,,, _mmmm_pppp_))))_;;;;
- _2222_0000 _}}}}
- _2222_1111 _}}}}
- _2222_2222 _mmmm_pppp _==== _eeee_mmmm_pppp_;;;;
- _2222_3333 _}}}}
- _2222_4444 _}}}}
- RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
- _gggg_eeee_tttt_qqqq(D3), _pppp_uuuu_tttt_bbbb_qqqq(D3), _pppp_uuuu_tttt_qqqq(D3), _rrrr_mmmm_vvvv_qqqq(D3), _ssss_rrrr_vvvv(D2)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-